home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 February / EnigmA AMIGA RUN 15 (1997)(G.R. Edizioni)(IT)[!][issue 1997-02][PLANET CD V].iso / progs / grafica / plotter3d / install-plotter3d < prev    next >
Text File  |  1997-01-02  |  11KB  |  360 lines

  1. ; $VER: Install-Plotter3D 2.04 (02.01.97)
  2.  
  3. ;##############################################################################
  4. ; global variables
  5.  
  6. (set ul_novice  0)
  7. (set ul_average 1)
  8. (set ul_expert  2)
  9.  
  10. ; last_choice contains the result of the last askoptions-call
  11. (set last_choice       0)
  12. ; need_conformation is used by CHECK_USERLEVEL
  13. (set need_confirmation 1)
  14.  
  15. ;##############################################################################
  16. ; Localize
  17. ;
  18.  
  19. (if (= @language "deutsch")
  20.   (
  21.     (set #update "Update")
  22.     (set #abort  "Abbrechen")
  23.  
  24.     (set #intro_1 "Willkommen zum Plotter3D Installation programm.")
  25.  
  26.     (set #cp_main   "Installiere Hauptprogramm 'Plotter3D'.")
  27.     (set #cp_docs   "Installiere Documentation.")
  28.     (set #cp_locale "Installiere Sprachen.")
  29.     (set #cp_funcs  "Kopiere Beispiel-Funktionen.")
  30.     (set #cp_mats   "Kopiere Beispiel-Materialen.")
  31.     (set #cp_lights "Kopiere Beispiel-Lightquellen.")
  32.     (set #cp_datas  "Kopiere Beispiel-Daten.")
  33.     (set #cp_pals   "Kopiere Standard-Farbpaletten.")
  34.  
  35.     (set #ask_update  "Plotter3D ist schon auf ihrem System installiert.\nSie können diese Installation updaten oder abbrechen.")
  36.     (set #ask_docs    "Bitte wählen Sie die Sprache(n) für die AmigaGuide Dokumentation aus.")
  37.     (set #ask_locale  "Bitte wählen Sie die Sprache(n) aus, die Sie installieren wollen.")
  38.     (set #ask_funcs   "Bitte wählen Sie die zu installierenden Beispiele aus.\n(Empfohlen: Alle)")
  39.     (set #ask_drawers "Bitte wählen Sie die Verzeichnisse aus, die kopiert werden sollen.\n(Empfohlen: Alle)")
  40.     (set #ask_others  "Bitte wählen Sie die Dateien aus, die kopiert werden sollen.")
  41.  
  42.     (set #destdir "Bitte wählen Sie einen Platz für Plotter3D. Ein Verzeichnis namens 'Plotter3D' wird dort automatisch erzeugt.")
  43.     (set #startup "Einige Kommandos werden zu ihrer \"s:user-startup\" Datei gefügt.")
  44.  
  45.     (set #user_abort "Fehler: Abbruch durch den Benutzer.")
  46.   )
  47.   (
  48.     (set #update "Update")
  49.     (set #abort  "Abort")
  50.  
  51.     (set #intro_1 "Welcome to the Plotter3D installation program.")
  52.  
  53.     (set #cp_main   "Installing main program 'Plotter3D'.")
  54.     (set #cp_docs   "Installing documentation.")
  55.     (set #cp_locale "Installing languages.")
  56.     (set #cp_funcs  "Copying example functions.")
  57.     (set #cp_mats   "Copying example materials.")
  58.     (set #cp_lights "Copying example lightsources.")
  59.     (set #cp_datas  "Copying example datas.")
  60.     (set #cp_pals   "Copying standard colorpalettes.")
  61.  
  62.     (set #ask_update  "Plotter3D is already installed on your system.\nYou can make an update or abort.")
  63.     (set #ask_docs    "Select the language(s) of AmigaGuide documentations you wish to install.")
  64.     (set #ask_locale  "Select the language(s) you wish to install.")
  65.     (set #ask_funcs   "Select the examples you wish to install.\n(Recommended: All)")
  66.     (set #ask_drawers "Select the drawers you wish to copy.\n(Recommended: All)")
  67.     (set #ask_others  "Select the files you wish to copy.")
  68.  
  69.     (set #destdir "Please select a place for the Plotter3D package. A drawer called 'Plotter3D' will be created here.")
  70.     (set #startup "Some commands will be added to your \"s:user-startup\" file.")
  71.  
  72.     (set #user_abort "Error: User abort.")
  73.   )
  74. )
  75.  
  76. ;#############################################################################
  77. ; procedure N_MAKEDIR
  78. ; creates a new drawer and copies the icon.
  79. ;
  80. ; #spath - source path
  81. ; #dpath - destination path
  82. ; #name  - name of drawer
  83.  
  84. (procedure N_MAKEDIR #spath #dpath #name
  85.   (
  86.     (if (= (exists (tackon #dpath #name) (noreq)) 0)
  87.       (
  88.         (makedir
  89.           (help @makedir-help)
  90.           (tackon #dpath #name)
  91.         )
  92.         (set #spath (expandpath #spath))
  93.         (copyfiles
  94.           (help @copyfiles-help)
  95.           (source (tackon #spath (cat #name ".info")))
  96.           (dest #dpath)
  97.           (infos)
  98.         )
  99.       )
  100.     )
  101.   )
  102. )
  103.  
  104. ;##############################################################################
  105. ; procedure COPYDIR
  106. ; copies a whole directory including all subdirectories. If an file exists
  107. ; it is not overwritten if it has an higher version.
  108. ;
  109. ; #name      - name of directory
  110. ; #help      - text shown during copy
  111. ; #overwrite - if TRUE then files without version are overwritten
  112.  
  113. (procedure COPYDIR #name #help #overwrite
  114.   (
  115.     (foreach #name "#?"
  116.       (
  117.         (if (> @each-type 0)
  118.           (
  119.             (COPYDIR (tackon #name @each-name) #help)
  120.           )
  121.           (
  122.             (set cd_source (tackon #name @each-name))
  123.             (set cd_dest   (tackon (tackon @default-dest #name) @each-name))
  124.             (if (= (exists cd_dest) 0)
  125.               (set cd_doit TRUE)
  126.               (
  127.                 (set cd_doit FALSE)
  128.                 (set cd_version (GETVERSION cd_dest))
  129.                 (if (<> cd_version 0)
  130.                   (if (> (GETVERSION cd_source) cd_version)
  131.                     (set cd_doit TRUE)
  132.                   )
  133.                   (if #overwrite
  134.                     (set cd_doit TRUE)
  135.                   )
  136.                 )
  137.               )
  138.             )
  139.             (if cd_doit
  140.               (copyfiles
  141.                 (prompt #help)
  142.                 (help @copyfiles-help)
  143.                 (source cd_source)
  144.                 (dest (tackon @default-dest #name))
  145.               )
  146.             )
  147.           )
  148.         )
  149.       )
  150.     )
  151.   )
  152. )
  153.  
  154. ;##############################################################################
  155. ; procedure COPYFILE
  156. ; copies a file (with icon)
  157. ;
  158. ; #path   - path of file
  159. ; #name   - name of file
  160. ; #prompt - text for prompt
  161. ;
  162. (procedure COPYFILE #path #name #prompt
  163.   (
  164.     (copyfiles
  165.       (prompt #prompt)
  166.       (help @copyfiles-help)
  167.       (source (tackon #path #name))
  168.       (dest (tackon @default-dest #path))
  169.       (infos))
  170.   )
  171. )
  172.  
  173. ;##############################################################################
  174. ; procedure CHECK_USERLEVEL
  175. ; set variable need_confirmation to TRUE if current user level is higher or
  176. ; equal to #minlevel.
  177. ;
  178. ; #minlevel    - minimal user level (ul_XXX)
  179. ; #last_choice - default value for last_choice variable
  180. ;
  181. (procedure CHECK_USERLEVEL #minlevel #last_choice
  182.   (
  183.     (if (>= @user-level #minlevel)
  184.       (
  185.         (set need_confirmation TRUE)
  186.       )
  187.       (
  188.         (set last_choice #last_choice)
  189.         (set need_confirmation FALSE)
  190.       )
  191.     )
  192.   )
  193. )
  194.  
  195. ;(procedure USER_ABORT
  196. ;  (
  197. ;    (ABORT #user_abort)
  198. ;  )
  199. ;)
  200.  
  201. ;##############################################################################
  202. ; start
  203.  
  204. (complete 0)
  205.  
  206. (if (<> (exists "plotter3d:" (noreq)) 0)
  207.   (
  208.     (if (askbool (prompt #ask_update) (choices #update #abort) (help @askbool-help))
  209.       (
  210.         (set @default-dest (expandpath "plotter3d:/"))
  211.       )
  212.       (
  213.         (exit (quiet))
  214.       )
  215.     )
  216.   )
  217.   (
  218.     (set @default-dest
  219.       (askdir
  220.         (prompt #destdir)
  221.         (help @askdir-help)
  222.         (default @default-dest)
  223.       )
  224.     )
  225.     (set @default-dest (expandpath @default-dest))
  226.     (N_MAKEDIR "/" @default-dest "Plotter3D")
  227.     (tooltype (dest (tackon @default-dest "Plotter3D")) (noposition))
  228.   )
  229. )
  230.  
  231. (complete 10)
  232. (set @default-dest (tackon @default-dest "Plotter3D"))
  233.  
  234. ;##############################################################################
  235. ; copy Main Program
  236.  
  237. (copylib
  238.   (prompt #cp_main)
  239.   (help @copylib-help)
  240.   (source "Plotter3D")
  241.   (dest @default-dest)
  242.   (infos)
  243. )
  244.  
  245. ;##############################################################################
  246. ; copy documentation
  247.  
  248. (complete 20)
  249. (N_MAKEDIR "" @default-dest "Docs")
  250. (COPYFILE "Docs" "History" #cp_docs)
  251. (COPYFILE "Docs" "Bugs"    #cp_docs)
  252.  
  253. (CHECK_USERLEVEL ul_average -1)
  254. (if need_confirmation
  255.   (set last_choice
  256.     (askoptions
  257.        (prompt #ask_docs)
  258.        (choices "English" "Deutsch")
  259.        (help @askoptions-help)
  260.     )
  261.   )
  262. )
  263. (if (<> last_choice 0)
  264.   (
  265.     (if (BITAND last_choice 1) ( (N_MAKEDIR "Docs" (tackon @default-dest "Docs") "English") (COPYDIR "Docs/English" #cp_docs TRUE)))
  266.     (if (BITAND last_choice 2) ( (N_MAKEDIR "Docs" (tackon @default-dest "Docs") "Deutsch") (COPYDIR "Docs/Deutsch" #cp_docs TRUE)))
  267.   )
  268. )
  269.  
  270. ;##############################################################################
  271. ; copy Locale
  272.  
  273. (complete 30)
  274. (CHECK_USERLEVEL ul_average -1)
  275. (if need_confirmation
  276.   (set last_choice
  277.     (askoptions
  278.       (prompt #ask_locale)
  279.       (choices "English" "Deutsch" "Français")
  280.       (help @askoptions-help)
  281.     )
  282.   )
  283. )
  284. (if (> last_choice 1)
  285.   (
  286.     (makedir (tackon @default-dest "Catalogs"))
  287.     (if (BITAND last_choice 2) ( (COPYDIR "Catalogs/Deutsch" #cp_locale TRUE) ))
  288.     (if (BITAND last_choice 4) ( (COPYDIR "Catalogs/Français" #cp_locale TRUE) ))
  289.   )
  290. )
  291.  
  292. ;##############################################################################
  293. ; install functions etc.
  294.  
  295. (complete 40)
  296. (CHECK_USERLEVEL ul_expert -1)
  297. (if need_confirmation
  298.   (set last_choice
  299.     (askoptions
  300.       (prompt #ask_funcs)
  301.       (choices "Functions" "Materials" "Lightsources" "Palettes" "Datas")
  302.       (help @askoptions-help)
  303.     )
  304.   )
  305. )
  306. (if (BITAND last_choice  1) ( (N_MAKEDIR "" @default-dest "Functions") (COPYDIR "Functions" #cp_funcs  TRUE)))
  307. (if (BITAND last_choice  2) ( (N_MAKEDIR "" @default-dest "Materials") (COPYDIR "Materials" #cp_mats   FALSE)))
  308. (if (BITAND last_choice  4) ( (N_MAKEDIR "" @default-dest "Lights"   ) (COPYDIR "Lights"    #cp_lights FALSE)))
  309. (if (BITAND last_choice  8) ( (N_MAKEDIR "" @default-dest "Palettes" ) (COPYDIR "Palettes"  #cp_pals   FALSE)))
  310. (if (BITAND last_choice 16) ( (N_MAKEDIR "" @default-dest "Datas"    ) (COPYDIR "Datas"     #cp_datas  FALSE)))
  311.  
  312. ;##############################################################################
  313. ; copy other drawers
  314.  
  315. (complete 60)
  316. (CHECK_USERLEVEL ul_expert -1)
  317. (if need_confirmation
  318.   (set last_choice
  319.     (askoptions
  320.       (prompt #ask_drawers)
  321.       (choices "Imagebuttons" "Preferences" "Tools")
  322.       (help @askoptions-help)
  323.     )
  324.   )
  325. )
  326. (if (BITAND last_choice 1) ( (N_MAKEDIR "" @default-dest "Images") (COPYDIR "Images" "" TRUE)))
  327. (if (BITAND last_choice 2) ( (N_MAKEDIR "" @default-dest "Prefs" ) (COPYDIR "Prefs"  "" FALSE)))
  328. (if (BITAND last_choice 4) ( (N_MAKEDIR "" @default-dest "Tools" ) (COPYDIR "Tools"  "" TRUE)))
  329.  
  330. ;##############################################################################
  331. ; install functions etc.
  332.  
  333. (complete 80)
  334. (CHECK_USERLEVEL ul_average -1)
  335. (if need_confirmation
  336.   (set last_choice
  337.     (askoptions
  338.       (prompt #ask_others)
  339.       (choices "Preview picture")
  340.       (help @askoptions-help)
  341.     )
  342.   )
  343. )
  344. (if (BITAND last_choice 1) (copyfiles (source "PreviewPic") (dest @default-dest) (infos) (help @copyfiles-help)))
  345.  
  346. ;##############################################################################
  347. ; startup-sequence
  348.  
  349. (complete 90)
  350. (startup "Plotter3D"
  351.   (prompt #startup)
  352.   (help @startup-help)
  353.   (command "assign Plotter3D: \"" @default-dest "\"")
  354.   (confirm "expert")
  355. )
  356.  
  357. (makeassign "Plotter3D" @default-dest)
  358.  
  359. (complete 100)
  360.